<%-- 
    Document   : teste
    Created on : 19/05/2013, 13:45:31
    Author     : Diego
--%>

<%@page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <link href="CSS/bootstrap.css" rel="stylesheet" type="text/css"/>
        <link href="CSS/estilo.css" rel="stylesheet" type="text/css"/>
        <title>Resultado</title>
        <%
            List<String> respostas = (List) session.getAttribute("respostas");
            List<String> listperguntas = (List) session.getAttribute("respostasCertas");
        %>
    </head>
    <body>
        
        
<div id="tudo">
<div id="cabecalho">
<p>
<img src="Imagens/TADS.png" />
<img src="Imagens/quiz_logo.png" /></p>
</div>
    
    <div id="mensagem">     
        <h1>Resultado Individual:</h1>
        <p>Quantidade de Acertos: ${acertos}</p>
            
            <table border="1px solid black">
                <thead>
                    <tr>
                    <th colspan="2">Questao</th>
                    <th colspan="2">Resp. Informada</th>
                    <th colspan="2">Resp. Certa</th>
                    <th colspan="2">Situação</th>
                    </tr>
                </thead>
                <tbody>
                    <c:forEach items="${respostas}" varStatus="i">
                        <tr>
                            <td colspan ="2"> <c:out value="${i.index}"/></td>
                            <td colspan="2">
                                <c:out value="${respostas.get(i.index)}"/>
                            </td>
                            <td colspan="2">
                                <c:out value="${respostasCertas.get(i.index).getCorreta()}"/>
                            </td>
                            <td colspan="2">
                                <c:choose>
                                    <c:when test ="${respostasCertas.get(i.index).getCorreta().equals(respostas.get(i.index))}">
                                        <img src="CSS/imagens/others/ok.png" width="30" height="30">
                                    </c:when>
                                    <c:otherwise>
                                        <img src="CSS/imagens/others/x1.jpg" width="30" height="30">
                                    </c:otherwise>
                                </c:choose>
                                
                            </td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>
        <a href="User/inicialUsuario.jsp" >Voltar a pagina principal</a>
        <form action="ServletDeEstatisticas" method="post">
        <input class="btn btn-primary" type="submit" value="Ir para estatisticas"/>
        </form>
        </div>
</div>
    </body>
</html>
